////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  camxipetf10register.cpp
/// @brief CamX IQ TF register update implementation
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Camx Headers
#include "camxipetf10register.h"
#include "camxiqinterface.h"
#include "camxutils.h"

CAMX_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFConfig0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFConfig0(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd,
    BOOL         resetReferenceInput)

{
    if (TRUE == resetReferenceInput)
    {
        pTFData->invalidMctfpImage = TRUE;
    }

    pPassRegCmd->config0.bitfields.INVALIDMCTFPIMAGE               = pTFData->invalidMctfpImage;
    pPassRegCmd->config0.bitfields.DISABLEOUTPUTINDICATIONS        = pTFData->disableOutputIndications;
    pPassRegCmd->config0.bitfields.USEINDICATIONS                  = pTFData->useIndications;
    pPassRegCmd->config0.bitfields.DISABLELUMAGHOSTDETECTION       = pTFData->disableLumaGhostDetection;
    pPassRegCmd->config0.bitfields.DISABLECHROMAGHOSTDETECTION     = pTFData->disableChromaGhostDetection;
    pPassRegCmd->config0.bitfields.SMEARINPUTSFORDECISIONS         = pTFData->smearInputsForDecisions;
    pPassRegCmd->config0.bitfields.USEANRFORDECISIONS_Y            = pTFData->useAnrForDecisions_Y;
    pPassRegCmd->config0.bitfields.USEANRFORDECISIONS_C            = pTFData->useAnrForDecisions_C;
    pPassRegCmd->config0.bitfields.ENABLELNR                       = pTFData->enableLNR;
    pPassRegCmd->config0.bitfields.ENABLENOISEESTBYLUMA            = pTFData->enableNoiseEstByLuma;
    pPassRegCmd->config0.bitfields.ENABLENOISEESTBYCHROMA          = pTFData->enableNoiseEstByChroma;
    pPassRegCmd->config0.bitfields.PADDINGBYREFLECTION             = pTFData->paddingByReflection;
    pPassRegCmd->config0.bitfields.SADYCALCMODE                    = pTFData->sadYCalcMode;
    pPassRegCmd->config0.bitfields.ISSADC5X3                       = pTFData->isSadC5x3;
    pPassRegCmd->config0.bitfields.LNRLUTSHIFTY                    = pTFData->LnrLutShiftY;
    pPassRegCmd->config0.bitfields.LNRLUTSHIFTC                    = pTFData->LnrLutShiftC;
    pPassRegCmd->config0.bitfields.ISDCI                           = pTFData->isDCI;
    pPassRegCmd->config0.bitfields.INDICATIONSDOMINATEFSDECISION   = pTFData->indicationsDominateFsDecision;
    pPassRegCmd->config0.bitfields.APPLYFSRANKFILTER               = pTFData->applyFsRankFilter;
    pPassRegCmd->config0.bitfields.APPLYFSLPF                      = pTFData->applyFsLpf;
    pPassRegCmd->config0.bitfields.TAKEOOFINDFROM                  = pTFData->takeOofIndFrom;
    pPassRegCmd->config0.bitfields.ISSAMEBLENDINGFORALLFREQUENCIES = pTFData->isSameBlendingForAllFrequencies;
    pPassRegCmd->config0.bitfields.FSDECISIONFREEPARAMSHIFTY       = pTFData->fsDecisionFreeParamShiftY;
    pPassRegCmd->config0.bitfields.FSDECISIONFREEPARAMSHIFTC       = pTFData->fsDecisionFreeParamShiftC;
    pPassRegCmd->config0.bitfields.OUTOFFRAMEPIXELSCONFIDENCE      = pTFData->outOfFramePixelsConfidence;

    CAMX_LOG_VERBOSE(CamxLogGroupPProc, "config 0 = 0x%lx", pPassRegCmd->config0.u32All);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFConfig1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFConfig1(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd,
    BOOL         resetReferenceInput)
{
    pPassRegCmd->config1.bitfields.IMG_CROPINENABLE              = pTFData->img_CropInEnable;
    pPassRegCmd->config1.bitfields.MCTFP_CROPINENABLE            = pTFData->mctfp_CropInEnable;
    pPassRegCmd->config1.bitfields.INDICATIONSDECREASEFACTOR     = pTFData->indicationsDecreaseFactor;
    pPassRegCmd->config1.bitfields.INVERTTEMPORALBLENDINGWEIGHTS = pTFData->invertTemporalBlendingWeights;
    pPassRegCmd->config1.bitfields.BLENDINGMODE                  = pTFData->blendingMode;
    pPassRegCmd->config1.bitfields.DITHERY                       = pTFData->ditherY;
    pPassRegCmd->config1.bitfields.DITHERCB                      = pTFData->ditherCb;
    pPassRegCmd->config1.bitfields.DITHERCR                      = pTFData->ditherCr;
    pPassRegCmd->config1.bitfields.TFOUT_CROPOUTHORIZASSUMESIZE  = pTFData->TfOut_CropOutHorizAssumeSize;
    pPassRegCmd->config1.bitfields.USEANROASIMGINPUT             = pTFData->useAnroAsImgInput;

    if (TRUE == resetReferenceInput)
    {
        pPassRegCmd->config1.bitfields.USEIMGASMCTFPINPUT            = 1;
    }
    else
    {
        pPassRegCmd->config1.bitfields.USEIMGASMCTFPINPUT            = pTFData->useImgAsMctfpInput;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFErodeConfig
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFErodeConfig(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_EN                = pTFData->morph_Erode_En;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_SIZE              = pTFData->Morph_Erode_Size;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_CROPOUTVERTENABLE = pTFData->Morph_Erode_CropOutVertEnable;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_CROPOUTVERTSTART  = pTFData->Morph_Erode_CropOutVertStart;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_CROPOUTVERTEND    = pTFData->Morph_Erode_CropOutVertEnd;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_CROPINHORIZLEFT   = pTFData->Morph_Erode_CropInHorizLeft;
    pPassRegCmd->erodeConfig.bitfields.MORPH_ERODE_CROPINHORIZRIGHT  = pTFData->Morph_Erode_CropInHorizRight;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFDilateConfig
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFDilateConfig(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->dilateConfig.bitfields.MORPH_DILATE_EN                = pTFData->morph_Dilate_En;
    pPassRegCmd->dilateConfig.bitfields.MORPH_DILATE_SIZE              = pTFData->Morph_Dilate_Size;
    pPassRegCmd->dilateConfig.bitfields.MORPH_DILATE_CROPOUTVERTENABLE = pTFData->Morph_Dilate_CropOutVertEnable;
    pPassRegCmd->dilateConfig.bitfields.MORPH_DILATE_CROPOUTVERTSTART  = pTFData->Morph_Dilate_CropOutVertStart;
    pPassRegCmd->dilateConfig.bitfields.MORPH_DILATE_CROPOUTVERTEND    = pTFData->Morph_Dilate_CropOutVertEnd;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFCropInHorizontalStart
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFCropInHorizontalStart(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->cropInHorizStart.bitfields.IMG_CROPINHORIZSTART   = pTFData->img_CropInHorizStart;
    pPassRegCmd->cropInHorizStart.bitfields.MCTFP_CROPINHORIZSTART = pTFData->mctfp_CropInHorizStart;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFCropInHorizontalEnd
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFCropInHorizontalEnd(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->cropInHorizEnd.bitfields.IMG_CROPINHORIZEND   = pTFData->img_CropInHorizEnd;
    pPassRegCmd->cropInHorizEnd.bitfields.MCTFP_CROPINHORIZEND = pTFData->mctfp_CropInHorizEnd;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFLNRStartIDXH
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFLNRStartIDXH(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->lnrStartIDXH.bitfields.LNRSTARTIDXH = pTFData->LnrStartIdxH;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFUpscaleCrop
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFUpscaleCrop(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPINHORIZLEFT   = pTFData->indUpscale_CropInHorizLeft;
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPINHORIZRIGHT  = pTFData->indUpscale_CropInHorizRight;
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPOUTHORIZLEFT  = pTFData->indUpscale_CropOutHorizLeft;
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPOUTHORIZRIGHT = pTFData->indUpscale_CropOutHorizRight;
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPOUTVERTTOP    = pTFData->indUpscale_CropOutVertTop;
    pPassRegCmd->usCrop.bitfields.INDUPSCALE_CROPOUTVERTBOTTOM = pTFData->indUpscale_CropOutVertBottom;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFIndCropConfig
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFIndCropConfig(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->indCropConfig.bitfields.OUTINDICATIONS_CROPENABLE        = pTFData->OutIndications_CropEnable;
    pPassRegCmd->indCropConfig.bitfields.OUTINDICATIONS_CROPOUTHORIZSTART = pTFData->OutIndications_CropOutHorizStart;
    pPassRegCmd->indCropConfig.bitfields.OUTINDICATIONS_CROPOUTHORIZEND   = pTFData->OutIndications_CropOutHorizEnd;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFPrngSeed
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFPrngSeed(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->prngSeed.bitfields.PRNGSEED = pTFData->prngSeed;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFRefConfigs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFRefConfigs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->refCfg0.bitfields.TRENABLE      = pTFData->trEnable;
    pPassRegCmd->refCfg0.bitfields.TRFSTHRESHOLD = pTFData->trFsThreshold;
    pPassRegCmd->refCfg0.bitfields.TRDEADZONE    = pTFData->trDeadZone;

    pPassRegCmd->refCfg1.bitfields.TRCOUNTTHRESHOLD = pTFData->trCountThreshold;

    pPassRegCmd->refCfg2.bitfields.TRSTARTX     = pTFData->trStartX;
    pPassRegCmd->refCfg2.bitfields.TRBLOCKNUMX  = pTFData->trBlockNumX;
    pPassRegCmd->refCfg2.bitfields.TRBLOCKSIZEX = pTFData->trBlockSizeX;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFCropInverts
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFCropInverts(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->cropInvertStart.bitfields.IMG_CROPINVERTSTART   = pTFData->img_CropInVertStart;
    pPassRegCmd->cropInvertStart.bitfields.MCTFP_CROPINVERTSTART = pTFData->mctfp_CropInVertStart;

    pPassRegCmd->cropInvertEnd.bitfields.IMG_CROPINVERTEND   = pTFData->img_CropInVertEnd;
    pPassRegCmd->cropInvertEnd.bitfields.MCTFP_CROPINVERTEND = pTFData->mctfp_CropInVertEnd;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFLNRStartIDXV
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFLNRStartIDXV(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->lnrStartIDXV.bitfields.LNRSTARTIDXV = pTFData->LnrStartIdxV;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFLNRScale
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFLNRScale(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->lnrScale.bitfields.LNRSCALEH = pTFData->LnrScaleH;
    pPassRegCmd->lnrScale.bitfields.LNRSCALEV = pTFData->LnrScaleV;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFCropOutVertical
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFCropOutVertical(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->cropOutVert.bitfields.OUTINDICATIONS_CROPOUTVERTSTART = pTFData->OutIndications_CropOutVertStart;
    pPassRegCmd->cropOutVert.bitfields.OUTINDICATIONS_CROPOUTVERTEND   = pTFData->OutIndications_CropOutVertEnd;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFRefYConfig
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFRefYConfig(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->refYCfg.bitfields.TRSTARTY     = pTFData->trStartY;
    pPassRegCmd->refYCfg.bitfields.TRBLOCKNUMY  = pTFData->trBlockNumY;
    pPassRegCmd->refYCfg.bitfields.TRBLOCKSIZEY = pTFData->trBlockSizeY;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamContribs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamContribs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpYContrib0.bitfields.NOISEPARAMSY_YTB_0  = pTFData->noiseParamsY_YTb[0];
    pPassRegCmd->tdNtNpYContrib0.bitfields.NOISEPARAMSCB_YTB_0 = pTFData->noiseParamsCb_YTb[0];
    pPassRegCmd->tdNtNpYContrib0.bitfields.NOISEPARAMSCR_YTB_0 = pTFData->noiseParamsCr_YTb[0];

    pPassRegCmd->tdNtNpYContrib1.bitfields.NOISEPARAMSY_YTB_1  = pTFData->noiseParamsY_YTb[1];
    pPassRegCmd->tdNtNpYContrib1.bitfields.NOISEPARAMSCB_YTB_1 = pTFData->noiseParamsCb_YTb[1];
    pPassRegCmd->tdNtNpYContrib1.bitfields.NOISEPARAMSCR_YTB_1 = pTFData->noiseParamsCr_YTb[1];

    pPassRegCmd->tdNtNpYContrib2.bitfields.NOISEPARAMSY_YTB_2  = pTFData->noiseParamsY_YTb[2];
    pPassRegCmd->tdNtNpYContrib2.bitfields.NOISEPARAMSCB_YTB_2 = pTFData->noiseParamsCb_YTb[2];
    pPassRegCmd->tdNtNpYContrib2.bitfields.NOISEPARAMSCR_YTB_2 = pTFData->noiseParamsCr_YTb[2];

    pPassRegCmd->tdNtNpYContrib3.bitfields.NOISEPARAMSY_YTB_3  = pTFData->noiseParamsY_YTb[3];
    pPassRegCmd->tdNtNpYContrib3.bitfields.NOISEPARAMSCB_YTB_3 = pTFData->noiseParamsCb_YTb[3];
    pPassRegCmd->tdNtNpYContrib3.bitfields.NOISEPARAMSCR_YTB_3 = pTFData->noiseParamsCr_YTb[3];

    pPassRegCmd->tdNtNpYContrib4.bitfields.NOISEPARAMSY_YTB_4  = pTFData->noiseParamsY_YTb[4];
    pPassRegCmd->tdNtNpYContrib4.bitfields.NOISEPARAMSCB_YTB_4 = pTFData->noiseParamsCb_YTb[4];
    pPassRegCmd->tdNtNpYContrib4.bitfields.NOISEPARAMSCR_YTB_4 = pTFData->noiseParamsCr_YTb[4];

    pPassRegCmd->tdNtNpYContrib5.bitfields.NOISEPARAMSY_YTB_5  = pTFData->noiseParamsY_YTb[5];
    pPassRegCmd->tdNtNpYContrib5.bitfields.NOISEPARAMSCB_YTB_5 = pTFData->noiseParamsCb_YTb[5];
    pPassRegCmd->tdNtNpYContrib5.bitfields.NOISEPARAMSCR_YTB_5 = pTFData->noiseParamsCr_YTb[5];

    pPassRegCmd->tdNtNpYContrib6.bitfields.NOISEPARAMSY_YTB_6  = pTFData->noiseParamsY_YTb[6];
    pPassRegCmd->tdNtNpYContrib6.bitfields.NOISEPARAMSCB_YTB_6 = pTFData->noiseParamsCb_YTb[6];
    pPassRegCmd->tdNtNpYContrib6.bitfields.NOISEPARAMSCR_YTB_6 = pTFData->noiseParamsCr_YTb[6];

    pPassRegCmd->tdNtNpYContrib7.bitfields.NOISEPARAMSY_YTB_7  = pTFData->noiseParamsY_YTb[7];
    pPassRegCmd->tdNtNpYContrib7.bitfields.NOISEPARAMSCB_YTB_7 = pTFData->noiseParamsCb_YTb[7];
    pPassRegCmd->tdNtNpYContrib7.bitfields.NOISEPARAMSCR_YTB_7 = pTFData->noiseParamsCr_YTb[7];

    pPassRegCmd->tdNtNpYContrib8.bitfields.NOISEPARAMSY_YTB_8  = pTFData->noiseParamsY_YTb[8];
    pPassRegCmd->tdNtNpYContrib8.bitfields.NOISEPARAMSCB_YTB_8 = pTFData->noiseParamsCb_YTb[8];
    pPassRegCmd->tdNtNpYContrib8.bitfields.NOISEPARAMSCR_YTB_8 = pTFData->noiseParamsCr_YTb[8];

    pPassRegCmd->tdNtNpYContrib9.bitfields.NOISEPARAMSY_YTB_9  = pTFData->noiseParamsY_YTb[9];
    pPassRegCmd->tdNtNpYContrib9.bitfields.NOISEPARAMSCB_YTB_9 = pTFData->noiseParamsCb_YTb[9];
    pPassRegCmd->tdNtNpYContrib9.bitfields.NOISEPARAMSCR_YTB_9 = pTFData->noiseParamsCr_YTb[9];

    pPassRegCmd->tdNtNpYContrib10.bitfields.NOISEPARAMSY_YTB_10  = pTFData->noiseParamsY_YTb[10];
    pPassRegCmd->tdNtNpYContrib10.bitfields.NOISEPARAMSCB_YTB_10 = pTFData->noiseParamsCb_YTb[10];
    pPassRegCmd->tdNtNpYContrib10.bitfields.NOISEPARAMSCR_YTB_10 = pTFData->noiseParamsCr_YTb[10];

    pPassRegCmd->tdNtNpYContrib11.bitfields.NOISEPARAMSY_YTB_11  = pTFData->noiseParamsY_YTb[11];
    pPassRegCmd->tdNtNpYContrib11.bitfields.NOISEPARAMSCB_YTB_11 = pTFData->noiseParamsCb_YTb[11];
    pPassRegCmd->tdNtNpYContrib11.bitfields.NOISEPARAMSCR_YTB_11 = pTFData->noiseParamsCr_YTb[11];

    pPassRegCmd->tdNtNpYContrib12.bitfields.NOISEPARAMSY_YTB_12  = pTFData->noiseParamsY_YTb[12];
    pPassRegCmd->tdNtNpYContrib12.bitfields.NOISEPARAMSCB_YTB_12 = pTFData->noiseParamsCb_YTb[12];
    pPassRegCmd->tdNtNpYContrib12.bitfields.NOISEPARAMSCR_YTB_12 = pTFData->noiseParamsCr_YTb[12];

    pPassRegCmd->tdNtNpYContrib13.bitfields.NOISEPARAMSY_YTB_13  = pTFData->noiseParamsY_YTb[13];
    pPassRegCmd->tdNtNpYContrib13.bitfields.NOISEPARAMSCB_YTB_13 = pTFData->noiseParamsCb_YTb[13];
    pPassRegCmd->tdNtNpYContrib13.bitfields.NOISEPARAMSCR_YTB_13 = pTFData->noiseParamsCr_YTb[13];

    pPassRegCmd->tdNtNpYContrib14.bitfields.NOISEPARAMSY_YTB_14  = pTFData->noiseParamsY_YTb[14];
    pPassRegCmd->tdNtNpYContrib14.bitfields.NOISEPARAMSCB_YTB_14 = pTFData->noiseParamsCb_YTb[14];
    pPassRegCmd->tdNtNpYContrib14.bitfields.NOISEPARAMSCR_YTB_14 = pTFData->noiseParamsCr_YTb[14];

    pPassRegCmd->tdNtNpYContrib15.bitfields.NOISEPARAMSY_YTB_15  = pTFData->noiseParamsY_YTb[15];
    pPassRegCmd->tdNtNpYContrib15.bitfields.NOISEPARAMSCB_YTB_15 = pTFData->noiseParamsCb_YTb[15];
    pPassRegCmd->tdNtNpYContrib15.bitfields.NOISEPARAMSCR_YTB_15 = pTFData->noiseParamsCr_YTb[15];

    pPassRegCmd->tdNtNpYContrib16.bitfields.NOISEPARAMSY_YTB_16  = pTFData->noiseParamsY_YTb[16];
    pPassRegCmd->tdNtNpYContrib16.bitfields.NOISEPARAMSCB_YTB_16 = pTFData->noiseParamsCb_YTb[16];
    pPassRegCmd->tdNtNpYContrib16.bitfields.NOISEPARAMSCR_YTB_16 = pTFData->noiseParamsCr_YTb[16];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamContribYs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamContribYs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpCContribY0.bitfields.NOISEPARAMSY_CTB_0 = pTFData->noiseParamsY_CTb[0];
    pPassRegCmd->tdNtNpCContribY0.bitfields.NOISEPARAMSY_CTB_1 = pTFData->noiseParamsY_CTb[1];

    pPassRegCmd->tdNtNpCContribY1.bitfields.NOISEPARAMSY_CTB_2 = pTFData->noiseParamsY_CTb[2];
    pPassRegCmd->tdNtNpCContribY1.bitfields.NOISEPARAMSY_CTB_3 = pTFData->noiseParamsY_CTb[3];

    pPassRegCmd->tdNtNpCContribY2.bitfields.NOISEPARAMSY_CTB_4 = pTFData->noiseParamsY_CTb[4];
    pPassRegCmd->tdNtNpCContribY2.bitfields.NOISEPARAMSY_CTB_5 = pTFData->noiseParamsY_CTb[5];

    pPassRegCmd->tdNtNpCContribY3.bitfields.NOISEPARAMSY_CTB_6 = pTFData->noiseParamsY_CTb[6];
    pPassRegCmd->tdNtNpCContribY3.bitfields.NOISEPARAMSY_CTB_7 = pTFData->noiseParamsY_CTb[7];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamContribCbs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamContribCbs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpCContribCB0.bitfields.NOISEPARAMSCB_CTB_0 = pTFData->noiseParamsCb_CTb[0];
    pPassRegCmd->tdNtNpCContribCB0.bitfields.NOISEPARAMSCB_CTB_1 = pTFData->noiseParamsCb_CTb[1];

    pPassRegCmd->tdNtNpCContribCB1.bitfields.NOISEPARAMSCB_CTB_2 = pTFData->noiseParamsCb_CTb[2];
    pPassRegCmd->tdNtNpCContribCB1.bitfields.NOISEPARAMSCB_CTB_3 = pTFData->noiseParamsCb_CTb[3];

    pPassRegCmd->tdNtNpCContribCB2.bitfields.NOISEPARAMSCB_CTB_4 = pTFData->noiseParamsCb_CTb[4];
    pPassRegCmd->tdNtNpCContribCB2.bitfields.NOISEPARAMSCB_CTB_5 = pTFData->noiseParamsCb_CTb[5];

    pPassRegCmd->tdNtNpCContribCB3.bitfields.NOISEPARAMSCB_CTB_6 = pTFData->noiseParamsCb_CTb[6];
    pPassRegCmd->tdNtNpCContribCB3.bitfields.NOISEPARAMSCB_CTB_7 = pTFData->noiseParamsCb_CTb[7];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamContribCrs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamContribCrs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpCContribCR0.bitfields.NOISEPARAMSCR_CTB_0 = pTFData->noiseParamsCr_CTb[0];
    pPassRegCmd->tdNtNpCContribCR0.bitfields.NOISEPARAMSCR_CTB_1 = pTFData->noiseParamsCr_CTb[1];

    pPassRegCmd->tdNtNpCContribCR1.bitfields.NOISEPARAMSCR_CTB_2 = pTFData->noiseParamsCr_CTb[2];
    pPassRegCmd->tdNtNpCContribCR1.bitfields.NOISEPARAMSCR_CTB_3 = pTFData->noiseParamsCr_CTb[3];

    pPassRegCmd->tdNtNpCContribCR2.bitfields.NOISEPARAMSCR_CTB_4 = pTFData->noiseParamsCr_CTb[4];
    pPassRegCmd->tdNtNpCContribCR2.bitfields.NOISEPARAMSCR_CTB_5 = pTFData->noiseParamsCr_CTb[5];

    pPassRegCmd->tdNtNpCContribCR3.bitfields.NOISEPARAMSCR_CTB_6 = pTFData->noiseParamsCr_CTb[6];
    pPassRegCmd->tdNtNpCContribCR3.bitfields.NOISEPARAMSCR_CTB_7 = pTFData->noiseParamsCr_CTb[7];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamUVLimit
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamUVLimit(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpUVLimit.bitfields.NOISEPARAMSY_UVLIMIT  = pTFData->noiseParamsY_UVlimit;
    pPassRegCmd->tdNtNpUVLimit.bitfields.NOISEPARAMSCB_UVLIMIT = pTFData->noiseParamsCb_UVlimit;
    pPassRegCmd->tdNtNpUVLimit.bitfields.NOISEPARAMSCR_UVLIMIT = pTFData->noiseParamsCr_UVlimit;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamTopLimit
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamTopLimit(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpTopLimit.bitfields.NOISEPARAMSY_TOPLIM  = pTFData->noiseParamsY_TopLim;
    pPassRegCmd->tdNtNpTopLimit.bitfields.NOISEPARAMSCB_TOPLIM = pTFData->noiseParamsCb_TopLim;
    pPassRegCmd->tdNtNpTopLimit.bitfields.NOISEPARAMSCR_TOPLIM = pTFData->noiseParamsCr_TopLim;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFNoiseParamBottomLimit
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFNoiseParamBottomLimit(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtNpBottomLimit.bitfields.NOISEPARAMSY_BOTLIM  = pTFData->noiseParamsY_BotLim;
    pPassRegCmd->tdNtNpBottomLimit.bitfields.NOISEPARAMSCB_BOTLIM = pTFData->noiseParamsCb_BotLim;
    pPassRegCmd->tdNtNpBottomLimit.bitfields.NOISEPARAMSCR_BOTLIM = pTFData->noiseParamsCr_BotLim;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFLNRLUTYs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFLNRLUTYs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtLnrLutY0.bitfields.LNRLUTY_0  = pTFData->LnrLutY[0];
    pPassRegCmd->tdNtLnrLutY0.bitfields.LNRLUTY_1  = pTFData->LnrLutY[1];
    pPassRegCmd->tdNtLnrLutY0.bitfields.LNRLUTY_2  = pTFData->LnrLutY[2];
    pPassRegCmd->tdNtLnrLutY0.bitfields.LNRLUTY_3  = pTFData->LnrLutY[3];

    pPassRegCmd->tdNtLnrLutY1.bitfields.LNRLUTY_4  = pTFData->LnrLutY[4];
    pPassRegCmd->tdNtLnrLutY1.bitfields.LNRLUTY_5  = pTFData->LnrLutY[5];
    pPassRegCmd->tdNtLnrLutY1.bitfields.LNRLUTY_6  = pTFData->LnrLutY[6];
    pPassRegCmd->tdNtLnrLutY1.bitfields.LNRLUTY_7  = pTFData->LnrLutY[7];

    pPassRegCmd->tdNtLnrLutY2.bitfields.LNRLUTY_8  = pTFData->LnrLutY[8];
    pPassRegCmd->tdNtLnrLutY2.bitfields.LNRLUTY_9  = pTFData->LnrLutY[9];
    pPassRegCmd->tdNtLnrLutY2.bitfields.LNRLUTY_10 = pTFData->LnrLutY[10];
    pPassRegCmd->tdNtLnrLutY2.bitfields.LNRLUTY_11 = pTFData->LnrLutY[11];

    pPassRegCmd->tdNtLnrLutY3.bitfields.LNRLUTY_12 = pTFData->LnrLutY[12];
    pPassRegCmd->tdNtLnrLutY3.bitfields.LNRLUTY_13 = pTFData->LnrLutY[13];
    pPassRegCmd->tdNtLnrLutY3.bitfields.LNRLUTY_14 = pTFData->LnrLutY[14];
    pPassRegCmd->tdNtLnrLutY3.bitfields.LNRLUTY_15 = pTFData->LnrLutY[15];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFLNRLUTCs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFLNRLUTCs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->tdNtLnrLutC0.bitfields.LNRLUTC_0  = pTFData->LnrLutC[0];
    pPassRegCmd->tdNtLnrLutC0.bitfields.LNRLUTC_1  = pTFData->LnrLutC[1];
    pPassRegCmd->tdNtLnrLutC0.bitfields.LNRLUTC_2  = pTFData->LnrLutC[2];
    pPassRegCmd->tdNtLnrLutC0.bitfields.LNRLUTC_3  = pTFData->LnrLutC[3];

    pPassRegCmd->tdNtLnrLutC1.bitfields.LNRLUTC_4  = pTFData->LnrLutC[4];
    pPassRegCmd->tdNtLnrLutC1.bitfields.LNRLUTC_5  = pTFData->LnrLutC[5];
    pPassRegCmd->tdNtLnrLutC1.bitfields.LNRLUTC_6  = pTFData->LnrLutC[6];
    pPassRegCmd->tdNtLnrLutC1.bitfields.LNRLUTC_7  = pTFData->LnrLutC[7];

    pPassRegCmd->tdNtLnrLutC2.bitfields.LNRLUTC_8  = pTFData->LnrLutC[8];
    pPassRegCmd->tdNtLnrLutC2.bitfields.LNRLUTC_9  = pTFData->LnrLutC[9];
    pPassRegCmd->tdNtLnrLutC2.bitfields.LNRLUTC_10 = pTFData->LnrLutC[10];
    pPassRegCmd->tdNtLnrLutC2.bitfields.LNRLUTC_11 = pTFData->LnrLutC[11];

    pPassRegCmd->tdNtLnrLutC3.bitfields.LNRLUTC_12 = pTFData->LnrLutC[12];
    pPassRegCmd->tdNtLnrLutC3.bitfields.LNRLUTC_13 = pTFData->LnrLutC[13];
    pPassRegCmd->tdNtLnrLutC3.bitfields.LNRLUTC_14 = pTFData->LnrLutC[14];
    pPassRegCmd->tdNtLnrLutC3.bitfields.LNRLUTC_15 = pTFData->LnrLutC[15];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFFsDecisionParamsYs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFFsDecisionParamsYs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->fsDecisionParamsY0.bitfields.FSDECISIONPARAMSY_C1_0 = pTFData->fsDecisionParamsY_c1[0];
    pPassRegCmd->fsDecisionParamsY0.bitfields.FSDECISIONPARAMSY_C2_0 = pTFData->fsDecisionParamsY_c2[0];
    pPassRegCmd->fsDecisionParamsY0.bitfields.FSDECISIONPARAMSY_C3_0 = pTFData->fsDecisionParamsY_c3[0];
    pPassRegCmd->fsDecisionParamsY0.bitfields.FSDECISIONPARAMSY_C4_0 = pTFData->fsDecisionParamsY_c4[0];

    pPassRegCmd->fsDecisionParamsY1.bitfields.FSDECISIONPARAMSY_C1_1 = pTFData->fsDecisionParamsY_c1[1];
    pPassRegCmd->fsDecisionParamsY1.bitfields.FSDECISIONPARAMSY_C2_1 = pTFData->fsDecisionParamsY_c2[1];
    pPassRegCmd->fsDecisionParamsY1.bitfields.FSDECISIONPARAMSY_C3_1 = pTFData->fsDecisionParamsY_c3[1];
    pPassRegCmd->fsDecisionParamsY1.bitfields.FSDECISIONPARAMSY_C4_1 = pTFData->fsDecisionParamsY_c4[1];

    pPassRegCmd->fsDecisionParamsY2.bitfields.FSDECISIONPARAMSY_C1_2 = pTFData->fsDecisionParamsY_c1[2];
    pPassRegCmd->fsDecisionParamsY2.bitfields.FSDECISIONPARAMSY_C2_2 = pTFData->fsDecisionParamsY_c2[2];
    pPassRegCmd->fsDecisionParamsY2.bitfields.FSDECISIONPARAMSY_C3_2 = pTFData->fsDecisionParamsY_c3[2];
    pPassRegCmd->fsDecisionParamsY2.bitfields.FSDECISIONPARAMSY_C4_2 = pTFData->fsDecisionParamsY_c4[2];

    pPassRegCmd->fsDecisionParamsY3.bitfields.FSDECISIONPARAMSY_C1_3 = pTFData->fsDecisionParamsY_c1[3];
    pPassRegCmd->fsDecisionParamsY3.bitfields.FSDECISIONPARAMSY_C2_3 = pTFData->fsDecisionParamsY_c2[3];
    pPassRegCmd->fsDecisionParamsY3.bitfields.FSDECISIONPARAMSY_C3_3 = pTFData->fsDecisionParamsY_c3[3];
    pPassRegCmd->fsDecisionParamsY3.bitfields.FSDECISIONPARAMSY_C4_3 = pTFData->fsDecisionParamsY_c4[3];

    pPassRegCmd->fsDecisionParamsY4.bitfields.FSDECISIONPARAMSY_C1_4 = pTFData->fsDecisionParamsY_c1[4];
    pPassRegCmd->fsDecisionParamsY4.bitfields.FSDECISIONPARAMSY_C2_4 = pTFData->fsDecisionParamsY_c2[4];
    pPassRegCmd->fsDecisionParamsY4.bitfields.FSDECISIONPARAMSY_C3_4 = pTFData->fsDecisionParamsY_c3[4];
    pPassRegCmd->fsDecisionParamsY4.bitfields.FSDECISIONPARAMSY_C4_4 = pTFData->fsDecisionParamsY_c4[4];

    pPassRegCmd->fsDecisionParamsY5.bitfields.FSDECISIONPARAMSY_C1_5 = pTFData->fsDecisionParamsY_c1[5];
    pPassRegCmd->fsDecisionParamsY5.bitfields.FSDECISIONPARAMSY_C2_5 = pTFData->fsDecisionParamsY_c2[5];
    pPassRegCmd->fsDecisionParamsY5.bitfields.FSDECISIONPARAMSY_C3_5 = pTFData->fsDecisionParamsY_c3[5];
    pPassRegCmd->fsDecisionParamsY5.bitfields.FSDECISIONPARAMSY_C4_5 = pTFData->fsDecisionParamsY_c4[5];

    pPassRegCmd->fsDecisionParamsY6.bitfields.FSDECISIONPARAMSY_C1_6 = pTFData->fsDecisionParamsY_c1[6];
    pPassRegCmd->fsDecisionParamsY6.bitfields.FSDECISIONPARAMSY_C2_6 = pTFData->fsDecisionParamsY_c2[6];
    pPassRegCmd->fsDecisionParamsY6.bitfields.FSDECISIONPARAMSY_C3_6 = pTFData->fsDecisionParamsY_c3[6];
    pPassRegCmd->fsDecisionParamsY6.bitfields.FSDECISIONPARAMSY_C4_6 = pTFData->fsDecisionParamsY_c4[6];

    pPassRegCmd->fsDecisionParamsY7.bitfields.FSDECISIONPARAMSY_C1_7 = pTFData->fsDecisionParamsY_c1[7];
    pPassRegCmd->fsDecisionParamsY7.bitfields.FSDECISIONPARAMSY_C2_7 = pTFData->fsDecisionParamsY_c2[7];
    pPassRegCmd->fsDecisionParamsY7.bitfields.FSDECISIONPARAMSY_C3_7 = pTFData->fsDecisionParamsY_c3[7];
    pPassRegCmd->fsDecisionParamsY7.bitfields.FSDECISIONPARAMSY_C4_7 = pTFData->fsDecisionParamsY_c4[7];

    pPassRegCmd->fsDecisionParamsY8.bitfields.FSDECISIONPARAMSY_C1_8 = pTFData->fsDecisionParamsY_c1[8];
    pPassRegCmd->fsDecisionParamsY8.bitfields.FSDECISIONPARAMSY_C2_8 = pTFData->fsDecisionParamsY_c2[8];
    pPassRegCmd->fsDecisionParamsY8.bitfields.FSDECISIONPARAMSY_C3_8 = pTFData->fsDecisionParamsY_c3[8];
    pPassRegCmd->fsDecisionParamsY8.bitfields.FSDECISIONPARAMSY_C4_8 = pTFData->fsDecisionParamsY_c4[8];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFFsDecisionParamsOOFs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFFsDecisionParamsOOFs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->fsDecisionParamsOOFY.bitfields.FSDECISIONPARAMSOOFY_C1 = pTFData->fsDecisionParamsOofY_c1;
    pPassRegCmd->fsDecisionParamsOOFY.bitfields.FSDECISIONPARAMSOOFY_C2 = pTFData->fsDecisionParamsOofY_c2;
    pPassRegCmd->fsDecisionParamsOOFY.bitfields.FSDECISIONPARAMSOOFY_C3 = pTFData->fsDecisionParamsOofY_c3;
    pPassRegCmd->fsDecisionParamsOOFY.bitfields.FSDECISIONPARAMSOOFY_C4 = pTFData->fsDecisionParamsOofY_c4;

    pPassRegCmd->fsDecisionParamsOOFC.bitfields.FSDECISIONPARAMSOOFC_C1 = pTFData->fsDecisionParamsOofC_c1;
    pPassRegCmd->fsDecisionParamsOOFC.bitfields.FSDECISIONPARAMSOOFC_C2 = pTFData->fsDecisionParamsOofC_c2;
    pPassRegCmd->fsDecisionParamsOOFC.bitfields.FSDECISIONPARAMSOOFC_C3 = pTFData->fsDecisionParamsOofC_c3;
    pPassRegCmd->fsDecisionParamsOOFC.bitfields.FSDECISIONPARAMSOOFC_C4 = pTFData->fsDecisionParamsOofC_c4;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFFsDecisionParamsCs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFFsDecisionParamsCs(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->fsDecisionParamsC0.bitfields.FSDECISIONPARAMSC_C1_0 = pTFData->fsDecisionParamsC_c1[0];
    pPassRegCmd->fsDecisionParamsC0.bitfields.FSDECISIONPARAMSC_C2_0 = pTFData->fsDecisionParamsC_c2[0];
    pPassRegCmd->fsDecisionParamsC0.bitfields.FSDECISIONPARAMSC_C3_0 = pTFData->fsDecisionParamsC_c3[0];
    pPassRegCmd->fsDecisionParamsC0.bitfields.FSDECISIONPARAMSC_C4_0 = pTFData->fsDecisionParamsC_c4[0];

    pPassRegCmd->fsDecisionParamsC1.bitfields.FSDECISIONPARAMSC_C1_1 = pTFData->fsDecisionParamsC_c1[1];
    pPassRegCmd->fsDecisionParamsC1.bitfields.FSDECISIONPARAMSC_C2_1 = pTFData->fsDecisionParamsC_c2[1];
    pPassRegCmd->fsDecisionParamsC1.bitfields.FSDECISIONPARAMSC_C3_1 = pTFData->fsDecisionParamsC_c3[1];
    pPassRegCmd->fsDecisionParamsC1.bitfields.FSDECISIONPARAMSC_C4_1 = pTFData->fsDecisionParamsC_c4[1];

    pPassRegCmd->fsDecisionParamsC2.bitfields.FSDECISIONPARAMSC_C1_2 = pTFData->fsDecisionParamsC_c1[2];
    pPassRegCmd->fsDecisionParamsC2.bitfields.FSDECISIONPARAMSC_C2_2 = pTFData->fsDecisionParamsC_c2[2];
    pPassRegCmd->fsDecisionParamsC2.bitfields.FSDECISIONPARAMSC_C3_2 = pTFData->fsDecisionParamsC_c3[2];
    pPassRegCmd->fsDecisionParamsC2.bitfields.FSDECISIONPARAMSC_C4_2 = pTFData->fsDecisionParamsC_c4[2];

    pPassRegCmd->fsDecisionParamsC3.bitfields.FSDECISIONPARAMSC_C1_3 = pTFData->fsDecisionParamsC_c1[3];
    pPassRegCmd->fsDecisionParamsC3.bitfields.FSDECISIONPARAMSC_C2_3 = pTFData->fsDecisionParamsC_c2[3];
    pPassRegCmd->fsDecisionParamsC3.bitfields.FSDECISIONPARAMSC_C3_3 = pTFData->fsDecisionParamsC_c3[3];
    pPassRegCmd->fsDecisionParamsC3.bitfields.FSDECISIONPARAMSC_C4_3 = pTFData->fsDecisionParamsC_c4[3];

    pPassRegCmd->fsDecisionParamsC4.bitfields.FSDECISIONPARAMSC_C1_4 = pTFData->fsDecisionParamsC_c1[4];
    pPassRegCmd->fsDecisionParamsC4.bitfields.FSDECISIONPARAMSC_C2_4 = pTFData->fsDecisionParamsC_c2[4];
    pPassRegCmd->fsDecisionParamsC4.bitfields.FSDECISIONPARAMSC_C3_4 = pTFData->fsDecisionParamsC_c3[4];
    pPassRegCmd->fsDecisionParamsC4.bitfields.FSDECISIONPARAMSC_C4_4 = pTFData->fsDecisionParamsC_c4[4];

    pPassRegCmd->fsDecisionParamsC5.bitfields.FSDECISIONPARAMSC_C1_5 = pTFData->fsDecisionParamsC_c1[5];
    pPassRegCmd->fsDecisionParamsC5.bitfields.FSDECISIONPARAMSC_C2_5 = pTFData->fsDecisionParamsC_c2[5];
    pPassRegCmd->fsDecisionParamsC5.bitfields.FSDECISIONPARAMSC_C3_5 = pTFData->fsDecisionParamsC_c3[5];
    pPassRegCmd->fsDecisionParamsC5.bitfields.FSDECISIONPARAMSC_C4_5 = pTFData->fsDecisionParamsC_c4[5];

    pPassRegCmd->fsDecisionParamsC6.bitfields.FSDECISIONPARAMSC_C1_6 = pTFData->fsDecisionParamsC_c1[6];
    pPassRegCmd->fsDecisionParamsC6.bitfields.FSDECISIONPARAMSC_C2_6 = pTFData->fsDecisionParamsC_c2[6];
    pPassRegCmd->fsDecisionParamsC6.bitfields.FSDECISIONPARAMSC_C3_6 = pTFData->fsDecisionParamsC_c3[6];
    pPassRegCmd->fsDecisionParamsC6.bitfields.FSDECISIONPARAMSC_C4_6 = pTFData->fsDecisionParamsC_c4[6];

    pPassRegCmd->fsDecisionParamsC7.bitfields.FSDECISIONPARAMSC_C1_7 = pTFData->fsDecisionParamsC_c1[7];
    pPassRegCmd->fsDecisionParamsC7.bitfields.FSDECISIONPARAMSC_C2_7 = pTFData->fsDecisionParamsC_c2[7];
    pPassRegCmd->fsDecisionParamsC7.bitfields.FSDECISIONPARAMSC_C3_7 = pTFData->fsDecisionParamsC_c3[7];
    pPassRegCmd->fsDecisionParamsC7.bitfields.FSDECISIONPARAMSC_C4_7 = pTFData->fsDecisionParamsC_c4[7];

    pPassRegCmd->fsDecisionParamsC8.bitfields.FSDECISIONPARAMSC_C1_8 = pTFData->fsDecisionParamsC_c1[8];
    pPassRegCmd->fsDecisionParamsC8.bitfields.FSDECISIONPARAMSC_C2_8 = pTFData->fsDecisionParamsC_c2[8];
    pPassRegCmd->fsDecisionParamsC8.bitfields.FSDECISIONPARAMSC_C3_8 = pTFData->fsDecisionParamsC_c3[8];
    pPassRegCmd->fsDecisionParamsC8.bitfields.FSDECISIONPARAMSC_C4_8 = pTFData->fsDecisionParamsC_c4[8];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFA3T1T2Scale
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFA3T1T2Scale(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->a3T1T2Scale.bitfields.A3T1SCALEY = pTFData->a3T1ScaleY;
    pPassRegCmd->a3T1T2Scale.bitfields.A3T1SCALEC = pTFData->a3T1ScaleC;
    pPassRegCmd->a3T1T2Scale.bitfields.A3T2SCALEY = pTFData->a3T2ScaleY;
    pPassRegCmd->a3T1T2Scale.bitfields.A3T2SCALEC = pTFData->a3T2ScaleC;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFA3T1OFFS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFA3T1OFFS(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->a3T1OFFS.bitfields.A3T1OFFSY = pTFData->a3T1OffsY;
    pPassRegCmd->a3T1OFFS.bitfields.A3T1OFFSC = pTFData->a3T1OffsC;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFA3T2OFFS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFA3T2OFFS(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->a3T2OFFS.bitfields.A3T2OFFSY = pTFData->a3T2OffsY;
    pPassRegCmd->a3T2OFFS.bitfields.A3T2OFFSC = pTFData->a3T2OffsC;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFA2MinMax
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFA2MinMax(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->a2MinMax.bitfields.A2MINY = pTFData->a2MinY;
    pPassRegCmd->a2MinMax.bitfields.A2MINC = pTFData->a2MinC;
    pPassRegCmd->a2MinMax.bitfields.A2MAXY = pTFData->a2MaxY;
    pPassRegCmd->a2MinMax.bitfields.A2MAXC = pTFData->a2MaxC;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFA2Slope
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFA2Slope(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->a2Slope.bitfields.A2SLOPEY = pTFData->a2SlopeY;
    pPassRegCmd->a2Slope.bitfields.A2SLOPEC = pTFData->a2SlopeC;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFFsToA1A4Maps
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFFsToA1A4Maps(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->fsToA1A4Map0.bitfields.FSTOA1MAPY_0 = pTFData->fsToA1MapY[0];
    pPassRegCmd->fsToA1A4Map0.bitfields.FSTOA1MAPC_0 = pTFData->fsToA1MapC[0];
    pPassRegCmd->fsToA1A4Map0.bitfields.FSTOA4MAPY_0 = pTFData->fsToA4MapY[0];
    pPassRegCmd->fsToA1A4Map0.bitfields.FSTOA4MAPC_0 = pTFData->fsToA4MapC[0];

    pPassRegCmd->fsToA1A4Map1.bitfields.FSTOA1MAPY_1 = pTFData->fsToA1MapY[1];
    pPassRegCmd->fsToA1A4Map1.bitfields.FSTOA1MAPC_1 = pTFData->fsToA1MapC[1];
    pPassRegCmd->fsToA1A4Map1.bitfields.FSTOA4MAPY_1 = pTFData->fsToA4MapY[1];
    pPassRegCmd->fsToA1A4Map1.bitfields.FSTOA4MAPC_1 = pTFData->fsToA4MapC[1];

    pPassRegCmd->fsToA1A4Map2.bitfields.FSTOA1MAPY_2 = pTFData->fsToA1MapY[2];
    pPassRegCmd->fsToA1A4Map2.bitfields.FSTOA1MAPC_2 = pTFData->fsToA1MapC[2];
    pPassRegCmd->fsToA1A4Map2.bitfields.FSTOA4MAPY_2 = pTFData->fsToA4MapY[2];
    pPassRegCmd->fsToA1A4Map2.bitfields.FSTOA4MAPC_2 = pTFData->fsToA4MapC[2];

    pPassRegCmd->fsToA1A4Map3.bitfields.FSTOA1MAPY_3 = pTFData->fsToA1MapY[3];
    pPassRegCmd->fsToA1A4Map3.bitfields.FSTOA1MAPC_3 = pTFData->fsToA1MapC[3];
    pPassRegCmd->fsToA1A4Map3.bitfields.FSTOA4MAPY_3 = pTFData->fsToA4MapY[3];
    pPassRegCmd->fsToA1A4Map3.bitfields.FSTOA4MAPC_3 = pTFData->fsToA4MapC[3];

    pPassRegCmd->fsToA1A4Map4.bitfields.FSTOA1MAPY_4 = pTFData->fsToA1MapY[4];
    pPassRegCmd->fsToA1A4Map4.bitfields.FSTOA1MAPC_4 = pTFData->fsToA1MapC[4];
    pPassRegCmd->fsToA1A4Map4.bitfields.FSTOA4MAPY_4 = pTFData->fsToA4MapY[4];
    pPassRegCmd->fsToA1A4Map4.bitfields.FSTOA4MAPC_4 = pTFData->fsToA4MapC[4];

    pPassRegCmd->fsToA1A4Map5.bitfields.FSTOA1MAPY_5 = pTFData->fsToA1MapY[5];
    pPassRegCmd->fsToA1A4Map5.bitfields.FSTOA1MAPC_5 = pTFData->fsToA1MapC[5];
    pPassRegCmd->fsToA1A4Map5.bitfields.FSTOA4MAPY_5 = pTFData->fsToA4MapY[5];
    pPassRegCmd->fsToA1A4Map5.bitfields.FSTOA4MAPC_5 = pTFData->fsToA4MapC[5];

    pPassRegCmd->fsToA1A4Map6.bitfields.FSTOA1MAPY_6 = pTFData->fsToA1MapY[6];
    pPassRegCmd->fsToA1A4Map6.bitfields.FSTOA1MAPC_6 = pTFData->fsToA1MapC[6];
    pPassRegCmd->fsToA1A4Map6.bitfields.FSTOA4MAPY_6 = pTFData->fsToA4MapY[6];
    pPassRegCmd->fsToA1A4Map6.bitfields.FSTOA4MAPC_6 = pTFData->fsToA4MapC[6];

    pPassRegCmd->fsToA1A4Map7.bitfields.FSTOA1MAPY_7 = pTFData->fsToA1MapY[7];
    pPassRegCmd->fsToA1A4Map7.bitfields.FSTOA1MAPC_7 = pTFData->fsToA1MapC[7];
    pPassRegCmd->fsToA1A4Map7.bitfields.FSTOA4MAPY_7 = pTFData->fsToA4MapY[7];
    pPassRegCmd->fsToA1A4Map7.bitfields.FSTOA4MAPC_7 = pTFData->fsToA4MapC[7];

    pPassRegCmd->fsToA1A4Map8.bitfields.FSTOA1MAPY_8 = pTFData->fsToA1MapY[8];
    pPassRegCmd->fsToA1A4Map8.bitfields.FSTOA1MAPC_8 = pTFData->fsToA1MapC[8];
    pPassRegCmd->fsToA1A4Map8.bitfields.FSTOA4MAPY_8 = pTFData->fsToA4MapY[8];
    pPassRegCmd->fsToA1A4Map8.bitfields.FSTOA4MAPC_8 = pTFData->fsToA4MapC[8];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SetTFConstantBlendingFactor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID SetTFConstantBlendingFactor(
    TF_REG*      pTFData,
    IPETFRegCmd* pPassRegCmd)
{
    pPassRegCmd->constantBlendingFactor.bitfields.CONSTANTBLENDINGFACTORY = pTFData->constantBlendingFactorY;
    pPassRegCmd->constantBlendingFactor.bitfields.CONSTANTBLENDINGFACTORC = pTFData->constantBlendingFactorC;
}

CAMX_NAMESPACE_END
